package cn.funeralobjects.upms.config;

import cn.funeralobjects.upms.api.ApiApi;
import cn.funeralobjects.upms.extension.mapping.RegisterApiHandlerMapping;
import cn.funeralobjects.upms.extension.util.ApiRequestMappingUtils;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.NonNull;
import org.springframework.web.reactive.config.WebFluxConfigurationSupport;
import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping;

import javax.annotation.Resource;


/**
 * 测试配置
 *
 * @author FuneralObjects
 * Create date: 2020/4/29 5:29 PM
 */
@Configuration
public class WebFluxTestConfigurer extends WebFluxConfigurationSupport {

    @Resource
    private ApiApi apiApi;

    @NonNull
    @Override
    protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
        return new RegisterApiHandlerMapping(apiApi, "upms", ApiRequestMappingUtils::defaultCreateNameFun);
    }


}
